<?php

class Page {

    static private $_Page;

    public $pid;
    public $controller;
    public $view;
    public $header = 'header.php';
    public $footer = 'footer.php';

    static public function getPage() {
        if (!isset(self::$_Page)) self::$_Page = new self();
        return self::$_Page;
    }

    private function __construct() {
        $c = 'index.php';
        $v = 'index.php';
        if (isset($_GET['page'])) {
            $pid = $_GET['page'];
            if ($pid=='test') {
                $v = 'test.php';
			} elseif ($pid == 'map'){
				$c = 'map.php';
				$v = 'map.php';
			} else {
                $pid = 'index';
            }
        } else {
            $pid = 'index';
        }

        $this->controller = $c;
        $this->view       = $v;
        $this->pid        = $pid;
    }

}

?>